<script id="template-semiauto-editor" type="text/html">
    <div class="widget-content semiauto-editor">
        <div class="k_box box-conditions">
            <table class="metrotable datatable thinkBox">
                <thead>
                <tr>
                    <th>维度</th>
                    <th>条件</th>
                    <th>比例</th>
                    <th>数据维度</th>
                    <th>参考数值</th>
                    <th></th>
                </tr>
                </thead>
                <tbody class="dimension-box" data-area="areaor">
                </tbody>
            </table>
        </div>
        <div class="k_box box-sources">
            <h4 class="inline-block">数据来源</h4>
            <div class="s-model inline-block">
                <span>计算机： <input type="radio" name="device" class="device" value="1"></span>
                <span>无线： <input type="radio" name="device" class="device" value="2"></span>
            </div>
        </div>
        <div class="k_box box-effective-dates effective-date-model">
            <h4 class="inline-block">参考数值时效</h4>
            <div class="s-model effective-date-section inline-block">
				<span>
					<select name="effective_date" class="effective-date" style="height:22px;">
                        <option value="1">昨天</option>
                        <option value="3">最近三天</option>
                        <option value="7">最近一周</option>
                        <option value="15">最近半个月</option>
                        <option value="30">最近一个月</option>
                        <option value="90">最近三个月</option>
                        <option value="0" data-customizable="cus-effective-date">自定义</option>
                    </select>
				</span>
				<span class="custom-time" style="display: none">
                    <input type="text" class="condition-input click-min cus-effective-date" name="cusEffectivedate" value="">
                    <strong style="margin-left: 5px;">天</strong>
				</span>
            </div>
        </div>
        <div class="k_box price-model box-price">
            <h4 class="inline-block">调价模式</h4>
            <div class="s-model inline-block">开启调价模式<input type="checkbox" style="vertical-align: middle;" class="priceModelStart"></div>
            <div class="s-model model-addbyfix" data-price-type="2">
                <span>原基础上调价</span>
				<span class="price_editor">
					<input type="radio" name="addbyfix" class="addbyfix checkable" value="1">降价
					<input type="radio" name="addbyfix" class="addbyfix checkable" value="2">提价
				</span>
				<span style="width:auto;">
					<input type="text" class="condition-input click-min addbyfixVal inputable origin" name="addbyfixVal">&nbsp;元
				</span>&nbsp;&nbsp;&nbsp;&nbsp;
				<span style="width:200px;" class="price_editor_origin">
					<span id="s-model-value-set-addbyfixVal" style="width:auto;">最高不得多于</span>
                    <input type="text" class="condition-input click-min addbyfixValMax inputable origin" name="addbyfixValMax" style="margin-left:5px;">&nbsp;元
				</span>
            </div>
            <div class="s-model model-addpricewithratio" data-price-type="1">
                <span>按百分比调价</span>
				<span>
					<input type="radio" name="addpricewithratio" class="addpricewithratio checkable" value="1">降价
					<input type="radio" name="addpricewithratio" class="addpricewithratio checkable" value="2">提价
				</span>
				<span style="width:auto;">
					<input type="text" class="condition-input click-min addpricewithratioVal inputable percent" name="addpricewithratioVal">&nbsp;%原价
				</span>&nbsp;&nbsp;&nbsp;&nbsp;
                    <span style="width:200px;" class="price_editor_percent">
                        <span id="s-model-value-set-addpricewithratioVal" style="width:auto;">最高不得多于</span>
                        <input type="text" class="condition-input click-min addpricewithratioValMax inputable percent" name="addpricewithratioValMax" style="margin-left:5px;">&nbsp;元
                    </span>
            </div>
            <div class="s-model model-setbyfixVal" data-price-type="3">
                <span>统一出价</span>
				<span>
					<input type="text" class="condition-input click-min setbyfixVal inputable" name="setbyfixVal">&nbsp;元
				</span>
            </div>
        </div>
        <div class="k_box matchscope-model box-match-scopes">
            <h4 class="inline-block">匹配模式</h4>
            <div class="s-model inline-block">
                <span style="width:auto;">开启匹配模式修改<input type="checkbox" style="vertical-align: middle; " class="matchscopeModel"></span>
            </div>
            <div class="s-model s-model-matchscopeModel">
                <span style="width:200px;margin-left:10px;">
					<input type="radio" name="matchscope" value="1" disabled="true" class="matchscope checkable fuzzy">广泛匹配
					<input type="radio" name="matchscope" value="3" disabled="true" class="matchscope checkable fix">精确匹配
				</span>
            </div>
        </div>
        <div class="k_box delete-model box-deletes">
            <h4 class="inline-block">删除</h4>
            <div class="s-model s-model-delete inline-block">
                <span style="width:auto;">删除符合条件的关键词<input type="checkbox" id="delete" name="delete" class="deleteModel" style="vertical-align: middle;"></span>
            </div>
        </div>

        <div class="k_box box-titles">
            <h4 class="inline-block">思路名称</h4>
            <div class="s-model s-model-title inline-block">
                <input type="text" class="think-name" name="thinkingName">
            </div>
        </div>

        <div class="center">
            <a href="javascript:;;;" class="button btn btn3 btn_grey stdbtn save-btn">保存思路</a><span class="loading-indicator"></span>
        </div>
    </div>
</script>

<script id="template-semiauto-editor-condition" type="text/html">
    <tr class="index-for-con <%=condition.class || 'condition'%>" data-type="<%=condition.method%>" data-condition-name="<%=condition.index%>" data-starter-index="<%=condition.starter%>">
        <td class="index-td">
            <select name="index_<%=condition.index%>" class="index-name">
                <option class="weidu" value=""></option>
                <% for(var i in default_index){ %>
                <option value="<%= default_index[i].name%>"><%= default_index[i].str%></option>
                <% } %>
            </select>
        </td>
        <td>
            <select name="conditions_<%=condition.index%>" class="conditions">
                <% for(var i in default_conditions){ %>
                <option value="<%= default_conditions[i].value%>"><%= default_conditions[i].str%></option>
                <% } %>
            </select>
        </td>
        <td>
            <input type="text" class="condition-input click-min" name="value_<%=condition.index%>" class="value" value="">&nbsp;&#37;
        </td>
        <td>
            <span style="margin-left:10px;">
                <input type="radio" name="depth_<%=condition.index%>" class="depth" value="4" checked="checked">自选
            </span>
        </td>
        <td>
            <span>
                <input type="radio" name="source_type_<%=condition.index%>" class="source-type" value="1">均值
                <span class="u-1"></span>
            </span>
            <span style="margin-left:10px;">
                <input type="radio" name="source_type_<%=condition.index%>" class="source-type" value="2">最大值
                <span class="u-2"></span>
            </span>
            <span style="margin-left:10px;">
                <input type="radio" name="source_type_<%=condition.index%>" class="source-type" value="3" data-customizable="source-value">自定义
                <input type="text" data-validate="true" class="condition-input click-min source-value" style="margin-left:5px;" name="source_value_<%=condition.index%>" >
                <span class="indexUnit"><%=condition.unit || ''%></span>
            </span>
        </td>
        <td>
            <button class="stdbtn add-index" type="button" data-type="and">增加指标 (并且)</button>
            <button class="stdbtn add-index" type="button" data-type="or">增加域 (或)</button>
            <button class="stdbtn delete-index" type="button">删除指标</button>
        </td>
    </tr>
</script>

<script id="template-semiauto-editor-condition-spliter" type="text/html">
    <tr class="spliter" data-starter-index="<%=starter%>">
        <td colspan="6">或者</td>
    </tr>
</script>